<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="./js/vue.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/vuex/3.2.0/vuex.min.js"></script>
    <title>Document</title>
  </head>
  <body>
    <div id="app1"></div>
    <div id="app2">{{reversedText}}</div>
  </body>
  <script>
    var app1 = new Vue({
      el: "#app",
      data: {
        text: "123,456"
      }
    })

    var app2 = new Vue({
      el: "#app2",
      computed: {
        reversedText: function () {
          //这里依赖的是实例app1的数据text
          return app1.text.split(",").reverse().join(",")
        }
      }
    })
  </script>
  <!-- 计算属性 还可以依赖其他实例的数据
--></html>
